﻿namespace _3DTicTacToe._3D
{
    struct Point3
    {
        public int X1 { get; set; }
        public int X2 { get; set; }
        public int X3 { get; set; }

        public override string ToString()
        {
            return string.Format("({0}|{1}|{2})", X1, X2, X3);
        }

        public static bool operator ==(Point3 a, Point3 b)
        {
            return (a.X1 == b.X1) &&
                   (a.X2 == b.X2) &&
                   (a.X3 == b.X3);
        }

        public static bool operator !=(Point3 a, Point3 b)
        {
            return !(a == b);
        }

        public override bool Equals(object obj)
        {
            return base.Equals(obj);
        }

        public override int GetHashCode()
        {
            return X1.GetHashCode() ^ X2.GetHashCode() ^ X3.GetHashCode();
        }

        public Point3(int x1, int x2, int x3)
            : this()
        {
            X1 = x1;
            X2 = x2;
            X3 = x3;
        }
    }
}
